<?php get_instance()->view('common/header');?>
<style>
<!--
.webuploader-pick {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: #00b7ee;
    padding: 5px 15px;
    color: #fff;
    text-align: center;
    border-radius: 3px;
    overflow: hidden;
}

.form-group {
    margin-bottom: 5px;
}
-->
</style>
<div class="page-container home">
  <?php get_instance()->view('common/sidebar');?>
  <div class="page-content-wrapper">
	  <div class="page-content">
	    <div class="row">
	      <div class="col-md-12">
	        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
	        <h3 class="page-title"> 运单管理 </h3>
	        <ul class="page-breadcrumb breadcrumb">
	          <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('home');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
	          <li> <i class="fa fa-home"></i> <a href="<?php echo getUrl('home');?>"> 首页  <i class="fa fa-angle-right"></i> </a></li>
	          <li><a href="javascript:void(0);">运单管理</a></li>
	        </ul>
	        <!-- END PAGE TITLE & BREADCRUMB-->
	      </div>
	    </div>
	    <div class="row" style="margin-top:10px;">
	      <div class="col-md-12">
	      <div class="well">
					<form>
	                    <div class="form-body">
	                    	<div class="row">
		                    	<div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">下单时间： </label>
		                                <div class="col-md-10">
		                                   <div class="input-group">
		                                   		<input dp class="form-control form-filter" placeholder="开始时间" type="text" name="date_from">
												<span class="input-group-addon">
													到
												</span>
												<input dp class="form-control form-filter" placeholder="结束时间" type="text" name="date_to">
											</div>
		                                </div>
		                           </div> 
	                           </div>  
	                           <div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">状态： </label>
		                                <div class="col-md-10">
		                                   <select class="form-control form-filter" name="status">
		                                   	   <option value="">所有</option>
		                                   	   <?php foreach ($status as $k => $v):?>
		                                   	   <option value="<?php echo $k;?>"><?php echo $v;?></option>
		                                   	   <?php endforeach;?>
		                                   </select> 
		                                </div>
		                           </div> 
	                           </div>  
                           </div>        
	                    	<div class="row" style="margin-top: 10px;">
		                    	<div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">运单编号： </label>
		                                <div class="col-md-10">
		                                   <input class="form-control form-filter" name="code" type="text">
		                                </div>
		                           </div> 
	                           </div>  
	                           <div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">类型：  </label>
		                                <div class="col-md-10">
		                                	  <select name="type" class="form-control form-filter">
												<option value="" selected="selected">所有</option>
												<?php foreach ($type as $k => $v):?>
												<option value="<?php echo $k;?>"><?php echo $v;?></option>
												<?php endforeach;?>
											</select>
		                                </div>
		                           </div> 
	                           </div>  
                           </div>        
	                    	<div class="row" style="margin-top: 10px;">
	                    	 <div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">配送员： </label>
		                                <div class="col-md-5">
		                                	<input class="form-control form-filter" name="deliveryman" type="text" placeholder="配送员名称">	 
		                                </div>
		                                <div class="col-md-5">
		                                	<input class="form-control form-filter" name="deliveryman_mobile" type="text" placeholder="联系电话"> 
		                                </div>
		                           </div> 
	                           </div> 
		                    	<div class="col-md-6">
			                     	<div class="form-group">
		                                <label class="control-label col-md-2">异常报备：</label>
		                                <div class="col-md-10">
											<select name="ap_status" class="form-control form-filter">
												<option value="">所有</option>
												<?php foreach ($apconfig as $k => $v):?>
												<option value="<?php echo $k;?>"><?php echo $v;?></option>
												<?php endforeach;?>
											</select>
		                                </div>
		                           </div> 
	                           </div>  
                           </div>        
	                    	<div class="row" style="margin-top: 10px;">
		                    	<div class="col-md-12">
			                     	<div class="form-group location">
		                                <label style="width: 8.17666667%;" class="control-label col-md-2">区域： </label>
		                                <div class="col-md-3">
		                                   <select class="form-control province form-filter" placeholder="省份" name="province">
		                                   	   <option value=""></option>
		                                   	   <?php foreach ($province as $v):?>
		                                   	   <option value="<?php echo $v['id'];?>"><?php echo $v['name'];?></option>
		                                   	   <?php endforeach;?>
		                                   </select>
		                                </div>
		                                <div class="col-md-3">
		                                   <select class="form-control city form-filter" placeholder="城市" name="city">
		                                     <option value=""></option>
		                                   </select>
		                                </div>
		                                <div class="col-md-3">
		                                   <select class="form-control form-filter county" name="county[]" placeholder="区县" multiple></select>
		                                </div>
		                           </div> 
	                           </div> 
	                           <script type="text/javascript">
	                           		$(function(){
	                           			localtion.init({boxId:".location",url:"<?php echo getUrl('deliveryman/member/getAreaByPid');?>"});	
	                           			$('select').val('').select2({allowClear:true});
		                           	});
	                           </script> 
                           </div>
                           <div class="row" style="margin-top: 10px;">
                           		<div class="col-md-6">
			                     	<div class="form-group">
			                     		<label class="control-label col-md-2"> </label>
		                           		<div class="col-md-6">
			                                   <button type="button" class="btn btn-default seach-btn"><i class="fa fa-search"></i> 搜索</button>
			                                   <script type="text/javascript">
													$(function(){
														$('.seach-btn').click(function(){
															$('#datatable').dataTable().fnDraw(true);
														});
														$('select').select2({allowClear:true});
													});
			                                   </script>
		                                </div>
                                	</div>
                                </div>
                           </div>     
	                    </div>	
                    </form>			 
				</div>
	      		<div class="portlet">
	            <div class="portlet-body">
	              <div class="table-container">
	                <div class="table-actions-wrapper"> <span> </span>
                    </div>
	                <table class="table table-bordered table-hover scoll-title" id="datatable">
	                  <thead>
	                    <tr role="row" class="heading">
	                      <th width="10%">下单日期</th>
	                      <th width="8%">运单编号</th>
	                      <th width="10%">区域</th>
	                      <th width="5%">配送员</th>
						  <th width="5%">配送距离</th>
						  <th width="5%">配送费</th>
						  <th width="6%">类型</th>
	                      <th width="10%">时间状态</th>
	                      <th width="7%">异常报备</th>
	                      <th width="6%">状态</th>
	                      <th width="8%">操作</th>
	                    </tr>
	                  </thead>
	                  <tbody>
	                  </tbody>
	                </table>
	              </div>
	            </div>
	          </div>
	      </div>
	    </div>
	  </div>
  </div>
</div>
<div id="ap-modal" class="modal modal_small" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">异常报备</h4>
      </div>
      <form class="form-horizontal" id="ap-form" method="post">
        <div class="modal-body">
        	<div class="form-group order">
                <label class="control-label col-md-3">原因：</label>
                <div class="col-md-9 text type">
                  	 
                </div>
            </div>
            <div class="form-group order">
                <label class="control-label col-md-3">备注：</label>
                <div class="col-md-9 text content">
                  	 
                </div>
            </div>
        </div>
        </form>
        <script type="text/javascript">
			$(function(){
				var modal = $('#ap-modal');
				$('.ap-content-btn').live('click', function(){
					modal.find('.type').html($(this).find('.type').html());
					modal.find('.content').html($(this).find('.content').html());
					modal.modal();
				});
			});
        </script>
    </div>
  </div>
</div>
<script type="text/javascript">
	$(function(){
		
        $('[dp]').not("[noinit]").datepicker({
            changeMonth: true,
            autoclose: true,
            format: "yyyy-mm-dd",
            language: 'zh-CN'
        });
        datatable_init({
			src: $("#datatable"),
			sAjaxSource: "<?php echo getUrl('deliveryman/order/getList');?>",
			"aLengthMenu": [[100, 50, 25], [100, 50, 25]],
            bSort:false,
		});	
	});
</script>
</body>
</html>